#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QColor>
#include <QColorDialog>
#include <QDateTime>
#include <QDebug>
#include <QDir>
#include <QFile>
#include <QFileDialog>
#include <QFont>
#include <QFontComboBox>
#include <QImage>
#include <QImageReader>
#include <QLabel>
#include <QMainWindow>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QMessageBox>
#include <QPalette>
#include <QPushButton>
#include <QProgressBar>
#include <QSpinBox>
#include <QStatusBar>
#include <QStyleFactory>
#include <QString>
#include <QTabWidget>
#include <QTextBrowser>
#include <QTextCodec>
#include <QTextCursor>
#include <QTextEdit>
#include <QTextStream>
#include <QTimer>
#include <QToolBar>
#include <QToolButton>
#include <QUrl>
#include "ui_mainwindow.h"
#include "textwindow.h"
#include "searchwindow.h"
#include "highlight.h"
#include "linenumberarea.h"
#include"emoji.h"

#include<QWidget>
const int max_page = 50;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT    //使用信号与槽的标志 
private:
    QLabel *label_text;
    QLabel *label_row;
    QSpinBox *spinbox;
    QFontComboBox *fontcombobox;
    SearchWindow *searchwindow;
    QTimer *time;            //计时器
    int count_text = 0;      //字数
    int count_row = 0;       //行数
    int count_page = 1;
    bool page_vised[max_page + 1] = {false};

    void intUI();            //初始化UI界面

    void connect_set();      //用于存储自定义的connect函数

    emoji *Emoji;
public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_actioncuti_triggered(bool checked);

    void on_actionxinjian_triggered();

    void spinBoxFontSize_valueChanged(int aFontSize);

    void comboFont_currentIndexChanged(const QString &argl);

    void on_actionxieti_triggered(bool checked);

    void on_actionxiahuaxian_triggered(bool checked);

    void on_actiondakai_triggered();

    bool openStreamText(const QString &filname);

    void on_actionbaocun_triggered();

    void on_actionyanse_2_triggered();

    void on_actionyouduiqi_triggered();

    void on_actionzuoduiqi_triggered();

    void on_actionjuzhongduiqi_triggered();

    void on_actionsousuohetihuan_triggered();

    void update_count();                        //更新字数, 行数等信息

    void compare_and_locate(bool);              //全文搜索并定位

    void replace(const QString, const QString); //替换

    void on_actiontupian_triggered();

    void on_actionbiaoge_triggered();

    void on_actionbiaoqing_triggered();

    void on_actionanse_triggered();

    void on_actionqingxin_triggered();

    void on_actionduocai_triggered();

    TextWindow* activeEdit();

    void on_actionjianqie_triggered();

    void on_actionfuzhi_triggered();

    void on_actionzhantie_triggered();

    void on_actioncode_triggered();

    int min_unvised();

    bool warning();

    void insert_emoji(QString path);

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H


